package StudyCode.summary.myfile;

import java.io.IOException;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class MyFileVisitor {
	public static void main(String args[]) {
		FileVisitor<Path> myFileVisitor = new SimpleFileVisitor<Path>() {
			@Override
			public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
				System.out.println(file.toString());
				return FileVisitResult.CONTINUE;
			}
		};

		FileSystem fileSystem = FileSystems.getDefault();
		Path directory = fileSystem.getPath("E:\\CODE\\JAVA\\ReviewCode\\src\\StudyCode\\");
		try {
			Files.walkFileTree(directory, myFileVisitor);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
